public class Exam03 {
    public static void main(String[] args) {
        int n=15;
        getSumChild(n);

    }
    private static void getSumChild(int n) {
        // 0非正数
        int a = 1;
        int b = 1;
        int sum = 1;
        while (a < (n / 2 +1)) {
            if (sum < n) {
                b++;
                sum = sum + b;
            } else if (sum > n) {
                sum = sum - a;
                a++;
            } else {
                for (int i = a; i <= b; i++) {
                    System.out.print(i + " ");
                }
                System.out.println();
                b++;
                sum = sum + b;
                sum = sum - a;
                a++;
            }

        }
    }

}
